// custom-tab-bar/index.ts
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    active: 0,
    urlList:[
      "/pages/myindex/myindex",
      "/pages/test/test",
      "/pages/my/my",
    ],
     list: [{
     pagePath: "/pages/myindex/myindex",
     text: "首页",
     iconPath: "../images/icons8-orange.png",
     selectedIconPath: "../images/icons8-orange-active.png"
    },
    {
      pagePath: "/pages/test/test",
      text: "消息",
      iconPath: "../images/icons8-mango.png",
      selectedIconPath: "../images/icons8-mango-active.png",
      info : 3
    },
    {
      pagePath: "/pages/my/my",
      text: "我的",
      iconPath: "../images/icons8-watermelon.png",
      selectedIconPath: "../images/icons8-watermelon-active.png"
    },
  ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange(event) {
      console.log(event.detail)
      console.log(this.data.urlList[event.detail])
      // event.detail 的值为当前选中项的索引
      this.setData({ active: event.detail })
      wx.switchTab({
        url:this.data.urlList[event.detail]
      })
    },
  }
})